home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / Interlace.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-10-12  |  2.3 KB  |  144 lines

  1. /*
  2.  
  3.    v1.00 Interlace (for Image Engineer)
  4.  
  5.    Marko Seppänen
  6.    marko.seppanen@wwnet.fi
  7.  
  8. */
  9.  
  10.  
  11. address IMAGEENGINEER
  12.  
  13. Options results
  14. signal on error            /* Setup a place for errors to go */
  15.  
  16.  
  17. if arg()=0 then exit
  18. x=arg(1)
  19. parse var x pic sec .
  20.  
  21.  
  22. if sec == "" then do
  23.  
  24.   GET PRIMARY
  25.   pic=result
  26.   GET SECONDARY
  27.   sec=result
  28.  
  29.  
  30.   if sec=="" then do
  31.     'REQUEST "Choose an SECONDARY image!" "Sorry"'
  32.     exit
  33.   end
  34.  
  35.   PROJECT_INFO pic WIDTH
  36.   picwidth=result
  37.   PROJECT_INFO pic HEIGHT
  38.   picheight=result
  39.   PROJECT_INFO pic ZOOM
  40.   piczoom=result
  41.  
  42.   PROJECT_INFO sec WIDTH
  43.   secwidth=result
  44.   PROJECT_INFO sec HEIGHT
  45.   secheight=result
  46.  
  47. end
  48. else do
  49.  
  50.   PROJECT_INFO pic WIDTH
  51.   picwidth=result
  52.   PROJECT_INFO pic HEIGHT
  53.   picheight=result
  54.   PROJECT_INFO pic ZOOM
  55.   piczoom=result
  56.  
  57.   PROJECT_INFO sec WIDTH
  58.   secwidth=result
  59.   PROJECT_INFO sec HEIGHT
  60.   secheight=result
  61.  
  62. end
  63.  
  64.  
  65. if picwidth ~== secwidth | picheight ~== secheight then do
  66.   'REQUEST "Secondary and Primary images must be same size!" "Ok"'
  67.   exit
  68. end
  69.  
  70.  
  71.  
  72. if exists("ie:alpha/lacelines.alpha") == "0" then do
  73.   'REQUEST "Please download VE-Extras.lha" "Ok"'
  74.   exit
  75. end
  76.  
  77.  
  78. OPEN "ie:alpha/lacelines.alpha" COLOUR
  79. lines=result
  80.  
  81. PROJECT_SET lines ZOOM piczoom
  82.  
  83. RESIZE lines picwidth picheight*2 TILE
  84. lacelines=result
  85. CLOSE lines
  86.  
  87.  
  88.  
  89.  
  90. SCALE pic picwidth picheight*2 FAST
  91. longpic=result
  92.  
  93. MARK lacelines PRIMARY
  94. MARK longpic SECONDARY
  95. COMPOSITE 0 0 MIN
  96. lacepic=result
  97.  
  98. CLOSE longpic
  99.  
  100.  
  101. SCALE sec secwidth secheight*2 FAST
  102. longsec=result
  103.  
  104. MARK lacelines PRIMARY
  105. MARK longsec SECONDARY
  106. COMPOSITE 0 1 MIN
  107. lacesec=result
  108.  
  109. CLOSE longsec
  110.  
  111.  
  112.  
  113. CLOSE lacelines
  114.  
  115. MARK lacepic PRIMARY
  116. MARK lacesec SECONDARY
  117. COMPOSITE 0 0 MAX
  118. final=result
  119.  
  120. CLOSE lacepic
  121. CLOSE lacesec
  122.  
  123.  
  124.  
  125. exit
  126.  
  127. /*******************************************************************/
  128. /* This is where control goes when an error code is returned by IE */
  129. /* It puts up a message saying what happened and on which line     */
  130. /*******************************************************************/
  131. error:
  132. if RC=5 then do            /* Did the user just cancel us? */
  133.     IE_TO_FRONT
  134.     LAST_ERROR
  135.     'REQUEST "'||RESULT||'"'
  136.     exit
  137. end
  138. else do
  139.     IE_TO_FRONT
  140.     LAST_ERROR
  141.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  142.     exit
  143. end
  144.